#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    long long maximumOr(vector<int> &nums, int k)
    {
        vector<long long> left(nums.size(), 0);
        vector<long long> right(nums.size(), 0);
        for (int i = 1; i < nums.size(); i++)
        {
            left[i] = left[i - 1] | nums[i - 1];
        }
        for (int i = nums.size() - 2; i >= 0; i--)
        {
            right[i] = right[i + 1] | nums[i + 1];
        }
        long long ans = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            ans = max(ans, left[i] | (nums[i] << k) | right[i]);
        }
        return ans;
    }
};

int main()
{
    cout << "Code2680" << endl;
    Solution s;
    return 0;
}